package com.mrjy.maintain.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.mrjy.common.entity.UserAddress;
import com.mrjy.maintain.bo.IUserAddressBo;

@Controller
@RequestMapping("/maintain/userAddress")
public class UserAddressController {
	
	@Resource
	private IUserAddressBo userAddressBo;
	
	/**
	 * 新增地址
	 * @param address
	 * @param session
	 * @return
	 */
	@RequestMapping("/insert")
	@ResponseBody
	public Object insert(UserAddress address,HttpSession session) {
		return userAddressBo.txInsert(address,session);
	}
	
	/**
	 * 根据userId查询用户地址
	 * @param address
	 * @param session
	 * @return
	 */
	@RequestMapping("/queryByUserId")
	@ResponseBody
	public Object queryByUserId(UserAddress address,HttpSession session) {
		return userAddressBo.queryByUserId(address,session);
	}
}
